﻿@model Apps.Models.Spl.Spl_WarehouseModel
@using Apps.Web.Core;
@using Apps.Common;
@using Apps.Models.Spl;
@using Apps.Web;
@using Apps.Locale;
@using Apps.Models.Sys;
@{
    ViewBag.Title = "修改";
    Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
    List<permModel> perm = null;
}

<script type="text/javascript">
$(function () {
    $("#btnSave").click(function () {
        if ($("form").valid()) {
            $.ajax({
                url: "@Url.Action("Edit")",
                type: "Post",
                data: $("form").serialize(),
                dataType: "json",
                success: function (data) {
                    if (data.type == 1) {
                        window.parent.frameReturnByMes(data.message);
                        window.parent.frameReturnByReload(true);
                        window.parent.frameReturnByClose()
                    }
                    else {
                        window.parent.frameReturnByMes(data.message);
                    }
                }
            });
        }
        return false;
    });
    $("#btnReturn").click(function () {
         window.parent.frameReturnByClose();
    });
});
</script>
<div class="mvctool bgb">
@Html.ToolButton("btnSave", "fa fa-save", Resource.Save,ref perm, "Save", true)
@Html.ToolButton("btnReturn", "fa fa-reply", Resource.Reply,false)
</div>
@using (Html.BeginForm())
{
             @Html.HiddenFor(model => model.Id)
             @Html.HiddenFor(model => model.CreateTime)
 <table class="formtable">
    <tbody>
        <tr>
            <th>
                @Html.LabelFor(model => model.WarehouseCategoryId)：
            </th>
            <td>
                 @Html.DropDownListFor(model => model.WarehouseCategoryId, ViewBag.WarehouseCategory as SelectList)
            </td>
            <td>@Html.ValidationMessageFor(model => model.WarehouseCategoryId)</td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.Name)：
            </th>
            <td >
                @Html.EditorFor(model => model.Name)
            </td>
            <td>@Html.ValidationMessageFor(model => model.Name)</td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.Code)：
            </th>
            <td >
                @Html.EditorFor(model => model.Code)
            </td>
            <td>@Html.ValidationMessageFor(model => model.Code)</td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.IsDefault)：
            </th>
            <td >
               @Html.SwitchDropdown("IsDefault", Model.IsDefault,"是","否")
            </td>
            <td>@Html.ValidationMessageFor(model => model.IsDefault)</td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.ContactPerson)：
            </th>
            <td >
                @Html.EditorFor(model => model.ContactPerson)
            </td>
            <td>@Html.ValidationMessageFor(model => model.ContactPerson)</td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.ContactPhone)：
            </th>
            <td >
                @Html.EditorFor(model => model.ContactPhone)
            </td>
            <td>@Html.ValidationMessageFor(model => model.ContactPhone)</td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.Address)：
            </th>
            <td >
                @Html.EditorFor(model => model.Address)
            </td>
            <td>@Html.ValidationMessageFor(model => model.Address)</td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.Remark)：
            </th>
            <td >
                @Html.EditorFor(model => model.Remark)
            </td>
            <td>@Html.ValidationMessageFor(model => model.Remark)</td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.Enable)：
            </th>
            <td >
                 @Html.SwitchDropdown("Enable", Model.Enable,"","")
            </td>
            <td>@Html.ValidationMessageFor(model => model.Enable)</td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.CreateTime)：
            </th>
            <td >
                @Html.EditorFor(model => model.CreateTime)
            </td>
            <td>@Html.ValidationMessageFor(model => model.CreateTime)</td>
        </tr>
    </tbody>
</table>
}

